package com.midian.model.activity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.midian.common.utils.StringUtil;
import com.midian.model.common.BaseModel;
import com.midian.model.pic.Pic;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Type;

import com.vividsolutions.jts.geom.Point;

/**
 * 活动图片
 * 
 */
@Entity
@Table(name = "activity_pic")
public class ActivityPic extends BaseModel {
	/**活动id*/
	private String activityId;
	/**活动图片*/
	@ManyToOne(optional=true,fetch=FetchType.LAZY)
	@JoinColumn(name="picId")
	@NotFound(action=NotFoundAction.IGNORE)
	private Pic actPic;
	
	
	public String getActivityId() {
		return activityId;
	}
	public void setActivityId(String activityId) {
		this.activityId = activityId;
	}

	public Pic getActPic() {
		return actPic;
	}
	public void setActPic(Pic actPic) {
		this.actPic = actPic;
	}
	
	/**活动图片地址*/
	@Transient
	public String getActPicIp() {
		String actPicIp="";
		if (this.actPic!=null) {
			actPicIp = StringUtil.getImageTips(this.actPic.getId());
		}
		return actPicIp;
		
	}
	
	
	
	
}
